2005-12-26 Matthias Clasen <mclasen@redhat.com>
+ * README.in: Mention the stripping of (_F) suffixes.
+
+ * gtk/gtktoolbar.c (_gtk_toolbar_elide_underscores): Strip a suffix of
+ the form " (_<single character>)", since this is the preferred way
+ for some languages to indicate accelerators. (#323956, Yang Hong)
+
* gtk/gtklabel.c (gtk_label_class_init): Add a gtk-label-select-on-focus
setting.
(gtk_label_grab_focus): And use it here to select the contents of
2005-12-26 Matthias Clasen <mclasen@redhat.com>
+ * README.in: Mention the stripping of (_F) suffixes.
+
+ * gtk/gtktoolbar.c (_gtk_toolbar_elide_underscores): Strip a suffix of
+ the form " (_<single character>)", since this is the preferred way
+ for some languages to indicate accelerators. (#323956, Yang Hong)
+
* gtk/gtklabel.c (gtk_label_class_init): Add a gtk-label-select-on-focus
setting.
(gtk_label_grab_focus): And use it here to select the contents of
reference. Details about floating references can be found in the docs:
http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Object-Type.html#floating-ref
+* Suffixes like (_F) are now stripped from labels when they are displayed
+ in toolbars. If this is not wanted, the feature can be suppressed by
+ inserting a Unicode control character, e.g ZWNJ.
+
Release notes
=============
gchar *q, *result;
const gchar *p;
gboolean last_underscore;
+ gint s;
if (!original)
return NULL;
- q = result = g_malloc (strlen (original) + 1);
+ s = strlen (original);
+ q = result = g_malloc (s + 1);
last_underscore = FALSE;
for (p = original; *p; p++)
*q++ = *p;
}
}
-
+
*q = '\0';
+
+ if (s > 4)
+ {
+ if (original[s - 5] == ' ' &&
+ original[s - 4] == '(' &&
+ original[s - 3] == '_' &&
+ original[s - 1] == ')')
+ q[-4] = '\0';
+ }
+
return result;
}